Skip to content

Fix Next router and make default query optional - #15

Merged
devgioele merged 3 commits into
mainfrom
new-api
Aug 7, 2023
Merged

Fix Next router and make default query optional#15
devgioele merged 3 commits into
mainfrom
new-api

Conversation

@devgioele

@devgioele devgioele commented Aug 7, 2023

Copy link
Copy Markdown

Optional default queries allow us to use the hook useQuery for parsing the query without having a default value. It allows us to receive the value from the query if it exists and is correct or undefined if otherwise. A typical use case is when a page is not rendered if a necessary query value is missing.

To support optional default queries, it was necessary to change the arguments order. Because this is a breaking change, the next version should be version 3.

@devgioele devgioele self-assigned this Aug 7, 2023

@mmalfertheiner mmalfertheiner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@devgioele
devgioele merged commit 2723c5e into main Aug 7, 2023
@devgioele
devgioele deleted the new-api branch August 7, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants